﻿using AlarmModule.Interfaces;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AlarmModule.Models {
    /// <summary>
    /// 报警参数配置类
    /// </summary>
    /// 
    [Table("AlarmParameter")]
    public partial class AlarmParameter : ObservableObject {
        [Key]
        [ObservableProperty]
        private int _id;
        /// <summary>
        /// 监控点名称（如"温度传感器1"）
        /// </summary>
        [ObservableProperty]
        private string _tagName;

        /// <summary>
        /// key的名字
        /// </summary>
        [ObservableProperty]
        private string _keyName;

        /// <summary>
        /// 当前值
        /// </summary>
        [ObservableProperty]
        private double? _value;

        /// <summary>
        /// 设定值（用于偏差报警）
        /// </summary>
        [ObservableProperty]
        private double _setpoint;


        /// <summary>
        /// 高低限阈值
        /// </summary>
        [ObservableProperty]
        private double _lowLowLimit;

        [ObservableProperty]
        private double _lowLimit;

        [ObservableProperty]
        private double _highLimit;


        [ObservableProperty]
        private double _highHighLimit;


        //偏差报警阈值 
        [ObservableProperty]
        private double _maxDeviation;

        // 滞环与延时
        [ObservableProperty]
        private double _hysteresis;

        [ObservableProperty]
        private int _triggerDelayMs;
        //类型,环境还是设备
        [ObservableProperty]
        private int? _type;

    }
}
